package com.cq.service.Impl;

import com.cq.dao.StuDao;
import com.cq.pojo.StuDorm;
import com.cq.pojo.Student;
import com.cq.service.StuService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StuServiceImpl implements StuService {

    private StuDao stuDao;

    @Autowired
    public void setStuDao(StuDao stuDao) {
        this.stuDao = stuDao;
    }

    @Override
    public Student queryOneByLogin(int key) {
        Student student = stuDao.queryStuByLogin(key);
        return student;
    }

    @Override
    public StuDorm queryDormByKey(int key) {
        StuDorm result = stuDao.queryDormByKey(key);
        return result;
    }

    @Override
    public int stuUpdateSelf(Student student) {
        int result = stuDao.stuUpdateSelfByKey(student);
        return result;
    }

    @Override
    public List<Student> queryAllStus() {
        List<Student> stus = stuDao.queryAllStus();
        return stus;
    }
}
